public static void bubbleSort(int [] a, int n){
    // 你的代码，使无序数组 a 变得有序
	for (int i = 0; i < n - 1; i++) {
		boolean swapped = false;
		for (int j = 0; j < n - 1 - i; j++) {
			if (a[j] > a[j + 1]) {
				int temp = a[j];
				a[j] = a[j + 1];
				a[j + 1] = temp;
				swapped = true;
			}
		}
		if (!swapped) {
			break;
		}
	}
} //end
